package util;

import java.util.Date ;

import utils.DateUtil ;
import utils.StringUtil;

public class ParameterUtil {

	//清理字符串
	public static String clearParameter(String text) {
		return clearParameter(text,"");
	}
	
	public static String clearParameter(String text,String source) {
		if(StringUtil.isEmpty(text)){
			return source;
		}
		return text.trim();
	}
	
	public static Date[] dateCombin(Date dateTop, Date dateEnd) {
		if (dateTop == null && dateEnd == null) {
			return null;
		}
		dateTop = DateUtil.topOfDay(dateTop);
		dateEnd = DateUtil.topOfDay(DateUtil.intervalDay(dateEnd,1));
		return new Date[] { dateTop, dateEnd };
	}
}
